/*
 * Copyright (c) 2024. hallele, Inc All rights reserved.
 */

package cn.hallele.ms.portalcenter.model.repository;

import cn.hallele.ms.portalcenter.model.entity.RoleEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Collection;
import java.util.List;

/**
 * RoleRepository
 *
 * @author anle5
 * @since 2024/5/29 23:23
 */
public interface RoleRepository extends JpaRepository<RoleEntity, Integer>, JpaSpecificationExecutor<RoleEntity> {
    /**
     * 通过id查询角色
     *
     * @param ids id集合
     * @return 角色集合结果
     */
    List<RoleEntity> findByIdIn(Collection<Integer> ids);

    /**
     * 通过roleCode查询role
     *
     * @param roleCodes roleCode集合
     * @return roles
     */
    List<RoleEntity> findByCodeIn(Collection<String> roleCodes);
}
